<!DOCTYPE html>
<html lang="{{ locale }}">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    {% if noindex -%}
    <meta name="robots" content="noindex">
    {%- endif %}

    {% include 'partials/meta.njk' %}
    {% block feed %}
      <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ site.url }}/feeds/all.xml">
      <link rel="alternate" type="application/rss+xml" title="{{ site.title }} - {{ 'i18n.common.blog' | i18n(locale) }}" href="{{ site.url }}/feeds/blog.xml">
      <link rel="alternate" type="application/rss+xml" title="{{ site.title }} - {{ 'i18n.common.articles' | i18n(locale) }}" href="{{ site.url }}/feeds/articles.xml">
    {% endblock %}

    <link rel="preload" as="font" crossorigin href="/fonts/google-sans-v2003/regular/latin.woff2">
    <link rel="preload" as="font" crossorigin href="/fonts/google-sans-v2003/medium/latin.woff2">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined" rel="stylesheet">

    {% block css %}
      {% InlineCss '/css/home.css' %}
      {% InlineCss '/css/devsite.css' %}
      {% InlineCss '/css/devsite-theme.css' %}
    {% endblock %}

    <script type="module" src="{{ helpers.hashForProd('/js/main.js') }}"></script>
    {% if process.env.NODE_ENV === 'production' %}
      <script async src="https://www.googletagmanager.com/gtm.js?id=GTM-5QF3RT2"></script>
    {% endif %}

    {# Private Aggregation API testing script #}
    {# The test will run until mid-April #}
    {% if process.env.NODE_ENV === 'production' %}
      <script type="module" defer src="https://shared-storage-demo-content-producer.web.app/paa/scripts/private-aggregation-test.js"></script>
    {% endif %}

    {# Add a facility for pages to declare an array of script paths. #}
    {# Note: We could also use this approach to load module/nomodule scripts #}
    {# https://philipwalton.com/articles/deploying-es2015-code-in-production-today/ #}
    {% if pageScripts %}
      {% for item in pageScripts %}
        <script type="module" src="{{ helpers.hashForProd(item) }}"></script>
      {% endfor %}
    {% endif %}

    {# Dogfood document speculation rules origin trial #}
    <!-- developer.chrome.com origin trial token - valid until 23 Mar 2023 -->
    <meta http-equiv="origin-trial" content="AhaT7AdLUbVk3M0VorYLzXSY8Km9PJZlzg3Xkv6KT2QMZ4zyqA5BfdTJLCj1TVnGhryWtQH66HWQEsIbZDUrsAwAAABseyJvcmlnaW4iOiJodHRwczovL2RldmVsb3Blci5jaHJvbWUuY29tOjQ0MyIsImZlYXR1cmUiOiJTcGVjdWxhdGlvblJ1bGVzUHJlZmV0Y2hGdXR1cmUiLCJleHBpcnkiOjE2OTQxMzExOTl9">
    {# Exclude the /articles/ section as a control #}
    <script type="speculationrules">
    {
      "prerender": [
        {
          "source": "document",
          "where": {
            "and": [
              {
                "href_matches": "/*\\?*", "relative_to": "document"
              },
              {
                "not": {
                  "href_matches": "/articles/*\\?*",
                  "relative_to": "document"
                }
              }
            ]
          },
          "eagerness": "moderate"
        }
      ]
    }
    </script>

    {# This needs to be include'd, because it expands 11ty variables #}
    <script>{% include 'partials/script.js' %}</script>

    {# Some articles may have previously used lists with anchors for their
    content (like FAQs) which may have evolved into their own articles by now.
    Such anchors should be able to link to those new articles #}
    {% if anchorRedirects %}
    <script>
      (() => {
        let anchorRedirects = {{ anchorRedirects|dump|safe }};

        function redirect(targetURL) {
          let {hash} = new URL(targetURL);
          if (!hash) {
            return;
          }

          hash = hash.substring(1);

          if (anchorRedirects[hash]) {
            window.location.replace(anchorRedirects[hash]);
          }
        }
        redirect(window.location.href);
        window.addEventListener('hashchange', (event) => redirect(event.newURL));
      })();
    </script>
    {% endif %}

  {% set isDevsite = true %}

  </head>
  <body class="" template="landing" theme="web-theme" type="article" layout="full" ready="" style="--devsite-js-header-height: 49px; --devsite-panel-height: 0px;">
    <div class="scaffold">
      {% block header %}
        {% include 'partials/top-nav.njk' %}
      {% endblock %}

      {% block sidebar %}
        {% include 'partials/side-nav.njk' %}
      {% endblock %}

      <section  class="dcc-devsite-wrapper" theme="web-theme">
        {% block devsite_main %}{% endblock %}
      </section>

      {% block footer %}
        {% include 'partials/footer.njk' %}
      {% endblock %}
    </div>
    {% include 'partials/cookie-banner.njk' %}

    {% block scripts %}{% endblock %}
  </body>
</html>
